package com.inspur.encache.startup;

import org.springframework.cache.annotation.Cacheable;

public class BookService {

    @Cacheable(value = { "globalCache" },key="#id")
    public String getBook(int id) {
        System.out.println("get book from db..");
        if (id == 1) {
            return "Book 1";
        } else {
            return "Book 2";
        }
    }

}